/* 
	system.h - fundamental functions used by the operating system  
	
	Written by Peter C. de Tagyos
	March 2009

*/

#ifndef __SYSTEM_H
#define __SYSTEM_H

/* Video colors */
#define C_BLACK 0x00
#define C_BLUE 0x01
#define C_GREEN 0x02
#define C_CYAN 0x03
#define C_RED 0x04
#define C_MAGENTA 0x05
#define C_BROWN 0x06
#define C_LTGREY 0x07
#define C_DKGREY 0x08
#define C_LTBLUE 0x09
#define C_LTGREEN 0x0A
#define C_LTCYAN 0x0B
#define C_LTRED 0x0C
#define C_LTMAGENTA 0x0D
#define C_LTBROWN 0x0E
#define C_WHITE 0x0F

/* Helpful type definitions */
typedef unsigned int size_t;

/* Memory functions from mem.c */
extern void *memcpy(void *dest, const void *src, size_t count);
extern void *memset(void *dest, unsigned char val, size_t count);
extern unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count);

/* String functions from string.c */
extern size_t strlen(const char *str);

/* Video screen functions from video.c */
extern void init_video();
extern void cls();
extern void putch(char ch);
extern void puts(char *str);
extern void scroll();
extern void settextcolor(unsigned char forecolor, unsigned char backcolor);
extern void updcsr();

/* I/O functions from io.c */
extern unsigned char inportb(unsigned short _port);
extern void outportb(unsigned short _port, unsigned char _data);

#endif
